const useAppStore = defineStore(
  // 唯一ID
  'app',
  () => {
    const currentFloor = ref<null | string>(null)

    function setFloor(to: null | string, route?: any, router?: any) {
      currentFloor.value = null
      setTimeout(() => {
        currentFloor.value = to
        if (route && route.path !== '/') {
          router.push({ path: '/' })
        }
      }, 1)
    }

    return {
      currentFloor,
      setFloor,
    }
  },
)

export default useAppStore
